Adjustment of the number of task control blocks allocated for discard scans

ABSTRACT

A controller receives a request to perform a release space operation. A determination is made that a new discard scan has to be performed on a cache, in response to the received request to perform the release space operation. A determination is made as to how many task control blocks are to be allocated to the perform the new discard scan, based on how many task control blocks have already been allocated for performing one or more discard scans that are already in progress.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of application Ser. No. 14/073,570filed on Nov. 6, 2013, wherein application Ser. No. 14/073,570 is acontinuation of application Ser. No. 13/569,951 filed on Aug. 8, 2012,wherein application Ser. No. 13/569,951 and application Ser. No.14/073,570 are incorporated herein by reference in their entirety.

BACKGROUND

1. Field

The disclosure relates to a method, system, and article of manufacturefor the adjustment of the number of task control blocks allocated fordiscard scans.

2. Background

A storage controller may be coupled to one or more of a plurality ofhosts. The storage controller may manage a plurality of storage devices,such as disk drives, tape drives, etc., that are coupled to the storagecontroller. The plurality of hosts may access data stored in the storagedevices via the storage controller.

The storage controller may maintain a cache, where a cache is a type ofstorage that is capable of providing faster access to data in comparisonto storage devices such as disk drives or tape drives. The storage spaceprovided by the cache is smaller in size than the storage space providedby the disk drives or tape drives, where the storage provided by thedisk drives or tape drives, and other devices, may be referred to assecondary storage. As a result, tracks may need to be staged (i.e.,moved to the cache from secondary storage) or destaged (i.e., moved fromthe secondary storage to the cache) to prevent the cache from becomingfull and to provide faster access to data. In many situations, torelease space in the cache, tracks may be discarded from the cache viadiscard scans.

A “Task Control Block” (TCB) is a data structure in the operating systemkernel containing the information needed to manage a particular process.Storage controllers may move information to and from storage devices,and to and from the cache by using TCBs to manage the movement of data.

SUMMARY OF THE PREFERRED EMBODIMENTS

Provided are a method, a system, and a computer program product in whicha controller receives a request to perform a release space operation. Adetermination is made that a new discard scan has to be performed on acache, in response to the received request to perform the release spaceoperation. A determination is made as to how many task control blocksare to be allocated to the perform the new discard scan, based on howmany task control blocks have already been allocated for performing oneor more discard scans that are already in progress.

In certain embodiments, in response to determining that the alreadyallocated number of task control blocks exceed a threshold, only onetask control block is allocated to perform the new discard scan.

In further embodiments, in response to determining that the alreadyallocated number of task control blocks does not exceed a threshold, aplurality of task control blocks are allocated to perform the newdiscard scan.

In yet further embodiments, the allocating of the plurality of taskcontrol blocks to perform the new discard scan further comprises,allocating an anchor task control block and then allocating subscan taskcontrol blocks to perform the new discard scan, wherein the anchor taskcontrol block and each of the subscan task control blocks are executedin parallel.

In additional embodiments, a determination is made as to whetherinput/output (I/O) operations on the cache that cannot be performedexceed a threshold number of I/O operations, wherein the I/O operationscannot be performed because of the discard scans that are already inprogress. In response to determining that the I/O operations on thecache that cannot be performed exceed the threshold number of I/Ooperations, an increased number of task control blocks are allocated foreach new discard scan if additional task control blocks are available.

In yet additional embodiments, the number of task control blocksallocated for all discard scans do not exceed ten percent of a total oftask control blocks in the controller.

In further embodiments, a determination is made that no additional taskcontrol blocks are available to allocate to the new discard scan. Thenew discard scan is queued until a task control block is made availablevia completion of at least one of the discard scans that are already inprogress.

BRIEF DESCRIPTION OF THE DRAWINGS

Referring now to the drawings in which like reference numbers representcorresponding parts throughout:

FIG. 1 illustrates a block diagram of a computing environment thatincludes a storage controller coupled to a host, in accordance withcertain embodiments;

FIG. 2 illustrates a block diagram that shows asynchronous discard scansbeing performed in a storage controller, in accordance with certainembodiments;

FIG. 3 illustrates flowchart that shows allocation of task controlblocks for asynchronous discard of tracks in a flash cache, inaccordance with certain embodiments;

FIG. 4 illustrates a block diagram that shows allocation of task controlblocks for different tasks, in accordance with certain embodiments;

FIG. 5 illustrates a block diagram that shows the allocation of ananchor task control block and subscan task control blocks, in accordancewith certain embodiments;

FIG. 6 illustrates a block diagram that shows how task control blockallocations are increased when too many I/O operations cannot beperformed, in accordance with certain embodiments;

FIG. 7 illustrates a flowchart that shows how task control blocks areallocated, in accordance with certain embodiments; and

FIG. 8 illustrates a block diagram of a computational system that showscertain elements that may be included in at least the storage controllerof FIG. 1, in accordance with certain embodiments.

DETAILED DESCRIPTION

In the following description, reference is made to the accompanyingdrawings which form a part hereof and which illustrate severalembodiments. It is understood that other embodiments may be utilized andstructural and operational changes may be made.

Storage space may be released in a storage controller for a plurality ofreasons. In certain embodiments, storage space may be released when avolume is deleted. In other embodiments, storage space may be released,in response to receiving a host command to reclaim storage space. Incertain embodiments, a flash cache is maintained in the storagecontroller to provide faster access to data to the host. For space to bereleased, tracks in flash cache may have to be discarded. A discard scanneeds to scan the cache directory and discard tracks corresponding tothe space being released. In certain embodiments, flash cache discardscans are performed asynchronously with respect to requests for spacerelease received from the host.

In certain embodiments, it is possible that there may be too many offlash cache discard scans running at some point in time, where the flashcache discard scans use a large number of task control blocks. Certainembodiments throttle the total number of task control blocks running atany given time, if the total number of task control blocks exceed athreshold. In certain other embodiments, the number of task controlblocks allocated to new discard scans may be increased if enough taskcontrol blocks are available.

Exemplary Embodiments

FIG. 1 illustrates a block diagram of a computing environment 100 thatincludes a storage controller 102 coupled to one or more hosts 104, inaccordance with certain embodiments. The storage controller managesstorage for the host 104, by controlling one or more storage devices106.

The storage controller 102 and the hosts 104 may comprise any suitablecomputational device including those presently known in the art, suchas, a personal computer, a workstation, a server, a mainframe, a handheld computer, a palm top computer, a telephony device, a networkappliance, a blade computer, a server, etc. The storage devices 106 maycomprise any suitable storage device including those presently known inthe art, such as magnetic disks, optical disks, tapes, etc. In certainembodiments, the host 104, the storage controller 102, and the storagedevices 106 may be coupled via a network, such as the Internet, anintranet, a storage area network, a local area network, etc.

The storage controller 102 may include a flash cache 108. In certainembodiments, the flash cache 108 may be comprised of a plurality ofsolid state disks. The flash cache 108 may provide caching services tocache data and provide faster access to data stored in the storagedevices 106. The data stored in the flash cache 108 and any otherstorage media either inside or coupled to the storage controller 102 maybe represented via storage representations 110, such as tracks, extents,volumes, logical subsystems, etc.

The storage controller 102 also includes an asynchronous discard scanapplication 112 that executes in the storage controller 102. Theasynchronous discard scan application 112 may be implemented insoftware, firmware, hardware, or any combination thereof. Theasynchronous discard scan application 112 when executed may performdiscard scan processes that are used to determine tracks to be discardedfrom the flash cache 108, to release space in the flash cache 108.

The storage controller 102 may also maintain a plurality of task controlblocks 112 a, 112 b . . . 112 n that are used for performing discardscans. Such task control blocks 112 a . . . 112 n may be referred to asdiscard scan TCBs.

Therefore, FIG. 1 illustrates certain embodiments in which a storagecontroller 102 maintains a flash cache 108 from which space may bereleased via an asynchronous discard scan application 112. Certainembodiments allow throttling of task control blocks based on the numberof task control blocks that are already being executed. Throttling oftask control blocks means that the number of task control blocks are notallowed to grow very fast, or are stabilized in number, or are reducedin number.

FIG. 2 illustrates a block diagram 200 that shows asynchronous discardscans being performed in the storage controller 102, in accordance withcertain embodiments.

In certain embodiments, the host 104 (acting as a client) may send thestorage controller 102 a release space command 202, where the releasespace command 202 may request that space is to be released by thestorage controller 102. The release of space may occur through variousmechanisms, such as deletion of space, reclamation of space, etc.

The storage controller 102 receives the release space command 202, andin response the asynchronous discard scan application 112 may start anasynchronous discard scan process 208 to scan a flash cache directorycorresponding to the flash cache 108, to determine tracks that are to bediscarded from the flash cache 108. The asynchronicity of theasynchronous discard scan process 208 is with respect to the releasespace command 202, i.e., the release space command 202 does not wait forcompletion while the asynchronous discard scan process 208 is beingexecuted.

Tracks are discarded asynchronously from the flash cache 108 because thememory size and the number of tracks in the flash cache 108 are of asufficiently large magnitude, such that the release space command 202may fail via timeouts, etc., should the release space command 202 waitwhile tracks are being discarded from the flash cache 108.

FIG. 3 illustrates flowchart 300 that shows allocation of task controlblocks for asynchronous discard of tracks in a flash cache 108, inaccordance with certain embodiments.

Control starts at block 302 in which the storage controller 102maintains a flash cache 108. The storage controller 102 receives (atblock 304) a release space command 202 from the host 104 to releasespace. To satisfy the release space command 202, the storage controller102 determines (at block 306) that that a new discard scan has to beperformed on a flash cache 108. The discard scan determines which tracksto discard from the flash cache 108.

Control proceeds to block 302 in which the storage controller 102determines how many task control blocks have already been allocated forperforming discard scans already in progress. If the allocated number oftask control blocks exceed a threshold (“Yes” branch from block 310)then in certain embodiments, one task control block is allocated (atblock 312) to perform the new discard scan. If the allocated number oftask control blocks does exceed a threshold (“No” branch from block 310)then a plurality of task control blocks are allocated (at block 314) toperform the new discard scan.

Therefore, FIG. 3 illustrates certain embodiments in which adetermination is made as to how many task control blocks are to beallocated to the perform the new discard scan, based on how many taskcontrol blocks have already been allocated for performing one or morediscard scans that are already in progress. In certain embodiments, inresponse to determining that the already allocated number of taskcontrol blocks exceed a threshold, only one task control block isallocated to perform the new discard scan. In other embodiments, inresponse to determining that the already allocated number of taskcontrol blocks does not exceed a threshold, a plurality of task controlblocks are allocated to perform the new discard scan. The threshold maybe set by a system administrator or may be determined by analyzinghistorical performance data collected on the efficiency of discard scanoperations based on various tentative thresholds.

FIG. 4 illustrates a block diagram 400 that shows allocation of taskcontrol blocks for different tasks in the storage controller 102, inaccordance with certain embodiments. In FIG. 4 the task control blocks402 a . . . 402 r may be used for purposes other than discard scans,whereas the task control blocks 404 a . . . 404 s may be used fordiscard scans. In certain embodiments, the total number of task controlblocks that may be used for discard scans is limited to be no more than10% of the total number of task control blocks in the storage controller102. Therefore, certain embodiments attempt to manage the total numberof task control blocks that are allocated for discard scans, and if toomany task control blocks are already allocated then try to slow down theamount of new allocation of task control blocks for discard scans.

FIG. 5 illustrates a block diagram 500 that shows the allocation of ananchor task control block and subscan task control blocks 504 a, 504 b,504 c, in accordance with certain embodiments. In certain embodiments,here are two levels of throttling for discard scans. In certainembodiments, a release space request from a client may request a discardscan from a flash cache. The release space may first synchronouslyallocate an anchor task control block (TCB) 502 for performing thediscards. Once the anchor TCB 502 is allocated, then a response can bereturned to the client to indicate completion of the flash cache discardscan. If there are enough overall TCBs allocated for flash cache discardscans (e.g., 10% of the maximum number of TCBs may be enough) then thediscard scans may wait for a TCB to be freed from one of the runningdiscard scan. In such embodiments, the client for the discard scan maybe requested to wait, until a TCB can be allocated to this discard scanby freeing up TCBs from running discard scans. This is the first levelof throttling. Additionally, once an anchor TCB is allocated, thediscard scan may try to allocate subscan TCBs 504 a . . . 504 c toprocess discard requests in parallel. It may be noted that the anchorTCB 502, and each of the subscan TCBs 504 a, 504 b, 504 c execute ondifferent processors 506, 508, 510, 512. If there are enough overallTCBs allocated for flash discard scans then subscan TCBs may not beallocated. This is the second level of throttling for discard scans (1to 2% of the maximum number of TCBs may be allocated in this level ofthrottling).

FIG. 6 illustrates a block diagram 600 that shows how task control blockallocations are increased when too many I/O operations cannot beperformed, in accordance with certain embodiments.

In FIG. 602, initially a new discard scan 602 is allocated two TCBs 604,606. After a certain amount of time, there may be many discard scans 608a . . . 608 p in progress. However, it is possible that a number of I/Ooperations 610 a . . . 610 q cannot be performed on the flash cache 108because when discard scans are in progress on areas of the flash cache,I/O operations cannot be performed to those areas.

In such embodiments, if the number of I/O operations that cannot beperformed exceeds a threshold (reference numeral 612) then new discardscans 614 may be allocated four TCBs 616, 618, 620, 622 by increasingthe allocation of TCBs (reference numeral 624), provided enough TCBs areavailable.

FIG. 7 illustrates a flowchart 700 that shows how task control blocksare allocated, in accordance with certain embodiments.

Control starts at block 702, in which a determination is made as towhether input/output (I/O) operations on the cache 108 that cannot beperformed exceed a threshold number of I/O operations, wherein the I/O.cannot be performed because of the discard scans that are already inprogress.

If at block 702 it is determined that the input/output (I/O) operationson the cache 108 that cannot be performed exceed a threshold number ofI/O operations (“Yes” branch from block 702) control proceeds to block704 in which a determination is made as to whether there are enoughadditional task control blocks available for discard scans.

From block 704, control proceeds to block 706 if enough additional taskcontrol blocks are available (“Yes” branch from block 704) and anincreased number of task control blocks are allocated (at block 706) foreach new discard scan.

If at block 702 it is determined that the number of I/O operations onthe cache 108 that cannot be performed does not exceed a threshold (“No”branch from block 702) or that not enough additional task control blocksare available for discard scans (“No” branch from block 704) thencontrol proceeds to block 708 in which the previous allocation of thenumber of task control blocks are maintained for each discard scan.

Therefore, FIGS. 1-7 illustrate certain embodiments in which theallocation of task control blocks for new discard scans are adjustedbased on how many task control blocks are already in use, how many taskcontrol blocks are available, and/or how many I/O operations on theflash cache are waiting because of the discard scans in progress. Thethrottling of task control blocks may be performed in a plurality oflevels.

Additional Embodiment Details

The described operations may be implemented as a method, apparatus orcomputer program product using standard programming and/or engineeringtechniques to produce software, firmware, hardware, or any combinationthereof. Accordingly, aspects of the embodiments may take the form of anentirely hardware embodiment, an entirely software embodiment (includingfirmware, resident software, micro-code, etc.) or an embodimentcombining software and hardware aspects that may all generally bereferred to herein as a “circuit,” “module” or “system.” Furthermore,aspects of the embodiments may take the form of a computer programproduct embodied in one or more computer readable medium(s) havingcomputer readable program code embodied there.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, or device, or any suitable combination of the foregoing. Morespecific examples (a non-exhaustive list) of the computer readablestorage medium would include the following: an electrical connectionhaving one or more wires, a portable computer diskette, a hard disk, arandom access memory (RAM), a read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or Flash memory), an optical fiber,a portable compact disc read-only memory (CD-ROM), an optical storagedevice, a magnetic storage device, or any suitable combination of theforegoing. In the context of this document, a computer readable storagemedium may be any tangible medium that can contain, or store a programfor use by or in connection with an instruction execution system,apparatus, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wireline, optical fiber cable, RF, etc., or any suitable combination ofthe foregoing.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java*, Smalltalk, C++ or the like and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on theuser's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider). * Java is a trademark or registered trademark of Oracleand/or its affiliates.

Aspects of the present invention are described below with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems) and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer program instructions. These computer program instructions maybe provided to a processor of a general purpose computer, specialpurpose computer, or other programmable data processing apparatus toproduce a machine, such that the instructions, which execute via theprocessor of the computer or other programmable data processingapparatus, create means for implementing the functions/acts specified inthe flowchart and/or block diagram block or blocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions whichimplement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

FIG. 8 illustrates a block diagram that shows certain elements that maybe included in the storage controller 102 in accordance with certainembodiments. The system 800 may comprise the storage controller 102 andmay include a circuitry 802 that may in certain embodiments include atleast a processor 804. The system 800 may also include a memory 806(e.g., a volatile memory device), and storage 808. The storage 808 mayinclude a non-volatile memory device (e.g., EEPROM, ROM, PROM, RAM,DRAM, SRAM, flash, firmware, programmable logic, etc.), magnetic diskdrive, optical disk drive, tape drive, etc. The storage 808 may comprisean internal storage device, an attached storage device and/or a networkaccessible storage device. The system 800 may include a program logic810 including code 812 that may be loaded into the memory 806 andexecuted by the processor 804 or circuitry 802. In certain embodiments,the program logic 810 including code 812 may be stored in the storage808. In certain other embodiments, the program logic 810 may beimplemented in the circuitry 802. Therefore, while FIG. 8 shows theprogram logic 810 separately from the other elements, the program logic810 may be implemented in the memory 806 and/or the circuitry 802.

Certain embodiments may be directed to a method for deploying computinginstruction by a person or automated processing integratingcomputer-readable code into a computing system, wherein the code incombination with the computing system is enabled to perform theoperations of the described embodiments.

The terms “an embodiment”, “embodiment”, “embodiments”, “theembodiment”, “the embodiments”, “one or more embodiments”, “someembodiments”, and “one embodiment” mean “one or more (but not all)embodiments of the present invention(s)” unless expressly specifiedotherwise.

The terms “including”, “comprising”, “having” and variations thereofmean “including but not limited to”, unless expressly specifiedotherwise.

The enumerated listing of items does not imply that any or all of theitems are mutually exclusive, unless expressly specified otherwise.

The terms “a”, “an” and “the” mean “one or more”, unless expresslyspecified otherwise.

Devices that are in communication with each other need not be incontinuous communication with each other, unless expressly specifiedotherwise. In addition, devices that are in communication with eachother may communicate directly or indirectly through one or moreintermediaries.

A description of an embodiment with several components in communicationwith each other does not imply that all such components are required. Onthe contrary a variety of optional components are described toillustrate the wide variety of possible embodiments of the presentinvention.

Further, although process steps, method steps, algorithms or the likemay be described in a sequential order, such processes, methods andalgorithms may be configured to work in alternate orders. In otherwords, any sequence or order of steps that may be described does notnecessarily indicate a requirement that the steps be performed in thatorder. The steps of processes described herein may be performed in anyorder practical. Further, some steps may be performed simultaneously.

When a single device or article is described herein, it will be readilyapparent that more than one device/article (whether or not theycooperate) may be used in place of a single device/article. Similarly,where more than one device or article is described herein (whether ornot they cooperate), it will be readily apparent that a singledevice/article may be used in place of the more than one device orarticle or a different number of devices/articles may be used instead ofthe shown number of devices or programs. The functionality and/or thefeatures of a device may be alternatively embodied by one or more otherdevices which are not explicitly described as having suchfunctionality/features. Thus, other embodiments of the present inventionneed not include the device itself.

At least certain operations that may have been illustrated in thefigures show certain events occurring in a certain order. In alternativeembodiments, certain operations may be performed in a different order,modified or removed. Moreover, steps may be added to the above describedlogic and still conform to the described embodiments. Further,operations described herein may occur sequentially or certain operationsmay be processed in parallel. Yet further, operations may be performedby a single processing unit or by distributed processing units.

The foregoing description of various embodiments of the invention hasbeen presented for the purposes of illustration and description. It isnot intended to be exhaustive or to limit the invention to the preciseform disclosed. Many modifications and variations are possible in lightof the above teaching. It is intended that the scope of the invention belimited not by this detailed description, but rather by the claimsappended hereto. The above specification, examples and data provide acomplete description of the manufacture and use of the composition ofthe invention. Since many embodiments of the invention can be madewithout departing from the spirit and scope of the invention, theinvention resides in the claims hereinafter appended.

What is claimed is:
 1. A method, comprising: receiving, by a controller,a request to perform a release space operation; determining that a newdiscard scan has to be performed on a cache, in response to the receivedrequest to perform the release space operation; and determining how manytask control blocks are to be allocated to perform the new discard scan,based on determining whether input/output (I/O) operations on the cachethat cannot be performed exceed a threshold number of I/O operations,the method further comprising: in response to determining that thealready allocated number of task control blocks exceed a thresholdnumber of task control blocks, allocating only one task control block toperform the new discard scan; and in response to determining that thealready allocated number of task control blocks does not exceed thethreshold number of task control blocks, allocating a plurality of taskcontrol blocks to perform the new discard scan, wherein the number oftask control blocks allocated for all discard scans do not exceed tenpercent of a total number of task control blocks in the controller, andwherein other task control blocks are used for purposes other thandiscard scans, and wherein the method further comprises: allocating ananchor task control block and then allocating subscan task controlblocks to perform the new discard scan, wherein the anchor task controlblock and each of the subscan task control blocks are executed inparallel; determining that no additional task control blocks areavailable to allocate to the new discard scan; and queuing the newdiscard scan until a task control block is made available via completionof at least one of the discard scans that are already in progress. 2.The method of claim 1, wherein the I/O operations on the cache cannot beperformed because of the discards scans that are already in progress. 3.The method of claim 2, wherein the determining of how many task controlblocks are to be allocated to perform the new discard scan is also basedon whether enough additional task control blocks are available forallocation to additional discard scans.
 4. The method of claim 1,wherein a previous allocation of number of task control blocks for eachdiscard scan is maintained if additional task control blocks are notavailable for discard scans.
 5. A system coupled to a cache, the systemcomprising: a memory; and a processor coupled to the memory, wherein theprocessor performs operations, the operations comprising: receiving arequest to perform a release space operation; determining that a newdiscard scan has to be performed on the cache, in response to thereceived request to perform the release space operation; and determininghow many task control blocks are to be allocated to perform the newdiscard scan, based on determining whether input/output (I/O) operationson the cache that cannot be performed exceed a threshold number of I/Ooperations, the operations further comprising: in response todetermining that the already allocated number of task control blocksexceed a threshold number of task control blocks, allocating only onetask control block to perform the new discard scan; and in response todetermining that the already allocated number of task control blocksdoes not exceed the threshold number of task control blocks, allocatinga plurality of task control blocks to perform the new discard scan,wherein the number of task control blocks allocated for all discardscans do not exceed ten percent of a total number of task control blocksin the controller, and wherein other task control blocks are used forpurposes other than discard scans, and wherein the operations furthercomprise: allocating an anchor task control block and then allocatingsubscan task control blocks to perform the new discard scan, wherein theanchor task control block and each of the subscan task control blocksare executed in parallel; determining that no additional task controlblocks are available to allocate to the new discard scan; and queuingthe new discard scan until a task control block is made available viacompletion of at least one of the discard scans that are already inprogress.
 6. The system of claim 5, wherein the I/O operations on thecache cannot be performed because of the discards scans that are alreadyin progress.
 7. The system of claim 6, wherein the determining of howmany task control blocks are to be allocated to perform the new discardscan is also based on whether enough additional task control blocks areavailable for allocation to additional discard scans.
 8. The system ofclaim 5, wherein a previous allocation of number of task control blocksfor each discard scan is maintained if additional task control blocksare not available for discard scans.
 9. A computer program product, thecomputer program product comprising a non-transitory computer readablestorage medium having computer readable program code embodied therewith,the computer readable program code configured to perform operations on acontroller coupled to a cache, the operations comprising: receiving, bythe controller, a request to perform a release space operation;determining that a new discard scan has to be performed on the cache, inresponse to the received request to perform the release space operation;and determining how many task control blocks are to be allocated toperform the new discard scan, based on determining whether input/output(I/O) operations on the cache that cannot be performed exceed athreshold number of I/O operations, the operations further comprising:in response to determining that the already allocated number of taskcontrol blocks exceed a threshold number of task control blocks,allocating only one task control block to perform the new discard scan;and in response to determining that the already allocated number of taskcontrol blocks does not exceed the threshold number of task controlblocks, allocating a plurality of task control blocks to perform the newdiscard scan, wherein the number of task control blocks allocated forall discard scans do not exceed ten percent of a total number of taskcontrol blocks in the controller, and wherein other task control blocksare used for purposes other than discard scans, and wherein theoperations further comprise: allocating an anchor task control block andthen allocating subscan task control blocks to perform the new discardscan, wherein the anchor task control block and each of the subscan taskcontrol blocks are executed in parallel; determining that no additionaltask control blocks are available to allocate to the new discard scan;and queuing the new discard scan until a task control block is madeavailable via completion of at least one of the discard scans that arealready in progress.
 10. The computer program product of claim 9,wherein the I/O operations on the cache cannot be performed because ofthe discards scans that are already in progress.
 11. The computerprogram product of claim 10, wherein the determining of how many taskcontrol blocks are to be allocated to perform the new discard scan isalso based on whether enough additional task control blocks areavailable for allocation to additional discard scans.
 12. The computerprogram product of claim 9, wherein a previous allocation of number oftask control blocks for each discard scan is maintained if additionaltask control blocks are not available for discard scans.